package com.example.demo.controller;

import com.example.demo.Utils.MinioUtils;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletResponse;

/**
 * @Author: lu
 * @Date: 2024-12-19-16:00
 * @Description:
 */
@RestController
@Api(tags = "COMMON公共接口，供前端直接调用（如文件上传等）")
@RequestMapping("/api/commonApi")
public class CommonController {

    @Autowired
    private MinioUtils minioUtils;

    @GetMapping("/downLoadWordToPDF")
    @ApiOperation("将word以pdf格式下载")
    public void downFileByPDF(HttpServletResponse response, @RequestParam("url") String url) throws Exception {
        minioUtils.downFileByPDF(response, url);
    }
}
